package cn.jji8.patternLogin.spigot;

import cn.jji8.patternLogin.spigot.data.Data;
import cn.jji8.patternLogin.spigot.login.Configuring;
import cn.jji8.patternLogin.spigot.login.LoginManager;
import cn.jji8.patternLogin.spigot.login.LoginNews;
import cn.jji8.patternLogin.spigot.login.LoginWorld;
import org.bukkit.plugin.java.JavaPlugin;


public class PatternLogin extends JavaPlugin {
    static PatternLogin patternLogin = null;
    @SuppressWarnings("unused")
    public PatternLogin(){ patternLogin =this; }
    public static PatternLogin getMain(){return patternLogin;}
    @Override
    public void onEnable() {
        Configuring.load(this);
        LoginWorld.load(this);
        Data.load(this);
        LoginManager loginManager = new LoginManager();
        getServer().getPluginManager().registerEvents(loginManager,this);
        LoginNews.load();

    }

    @Override
    public void onDisable() {
        LoginManager.serveAllPrayerLocation();//保存在线且已经登录的玩家数据
    }
}
